package com.ruoyi.pay.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.pay.domain.WxOrder;
import com.ruoyi.pay.mapper.WxOrderMapper;
import com.ruoyi.pay.service.IWxOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


/**
 * 微信商品订单Service业务层处理
 *
 * @author jiang
 * @date 2024-10-27
 */
@Service
public class WxOrderServiceImpl extends ServiceImpl<WxOrderMapper, WxOrder> implements IWxOrderService
{
    @Autowired
    private WxOrderMapper wxOrderMapper;

    @Override
    public WxOrder selectOne(QueryWrapper payWrapper) {
        return wxOrderMapper.selectOne(payWrapper);
    }



    /**
     * 查询微信商品订单
     *
     * @param uuid 微信商品订单主键
     * @return 微信商品订单
     */
    @Override
    public WxOrder selectWxOrderByUuid(String uuid)
    {
        return wxOrderMapper.selectWxOrderByUuid(uuid);
    }

    /**
     * 查询微信商品订单列表
     *
     * @param wxOrder 微信商品订单
     * @return 微信商品订单
     */
    @Override
    public List<WxOrder> selectWxOrderList(WxOrder wxOrder)
    {
        return wxOrderMapper.selectWxOrderList(wxOrder);
    }

    /**
     * 新增微信商品订单
     *
     * @param wxOrder 微信商品订单
     * @return 结果
     */
    @Override
    public int insertWxOrder(WxOrder wxOrder)
    {
                wxOrder.setCreateTime(DateUtils.getNowDate());
            return wxOrderMapper.insertWxOrder(wxOrder);
    }

    /**
     * 修改微信商品订单
     *
     * @param wxOrder 微信商品订单
     * @return 结果
     */
    @Override
    public int updateWxOrder(WxOrder wxOrder)
    {
                wxOrder.setUpdateTime(DateUtils.getNowDate());
        return wxOrderMapper.updateWxOrder(wxOrder);
    }

    /**
     * 批量删除微信商品订单
     *
     * @param uuids 需要删除的微信商品订单主键
     * @return 结果
     */
    @Override
    public int deleteWxOrderByUuids(String[] uuids)
    {
        return wxOrderMapper.deleteWxOrderByUuids(uuids);
    }

    /**
     * 删除微信商品订单信息
     *
     * @param uuid 微信商品订单主键
     * @return 结果
     */
    @Override
    public int deleteWxOrderByUuid(String uuid)
    {
        return wxOrderMapper.deleteWxOrderByUuid(uuid);
    }
}

